﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;

 namespace Restful
{
    [ServiceContract(Name = "ServiceLifeImp")]
    public interface ILifeService
    {
        /// <summary>
        /// 玩家之间加命值和弹量
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="addLifeValue"></param>
        /// <param name="addBulletCount"></param>
        /// <param name="currentUser"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(UriTemplate = "TransferPlayerLifeBulletCount/{userId}/{addLifeValue}/{addBulletCount}/{currentUser}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string TransferPlayerLifeBulletCount(string userId, string addLifeValue, string addBulletCount, string currentUser);

        /// <summary>
        /// 查询用户的命值信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(UriTemplate = "GetPlayerLifeInfoByUser/{userId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string GetPlayerLifeInfoByUser(string userId);


        //通过玩家获取当前房间的所有玩家的生命值
        [OperationContract]
        [WebGet(UriTemplate = "GetRoomLifeInfoByUser/{userId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string GetRoomLifeInfoByUser(string userId);

        //查询战绩
        [OperationContract]
        [WebGet(UriTemplate = "SearchFightScore/{userId}/{userType}/{currrentUser}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string SearchFightScore(string userId, string userType, string currrentUser);


        [OperationContract]
        [WebGet(UriTemplate = "SearchLifeByGrounp/{grounpId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string SearchLifeByGrounp(string grounpId);

        [OperationContract]
        [WebGet(UriTemplate = "UpdateLifeByGrounp/{grounpId}/{lifeValue}/{bulletCount}/{hitReduceLifeValue}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string UpdateLifeByGrounp(string grounpId,string lifeValue,string bulletCount,string hitReduceLifeValue);

        //[OperationContract]
        //[WebGet(UriTemplate = "SetGrounpLifeToUserList/{grounpId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        //string SetGrounpLifeToUserList(string grounpId);


        [OperationContract]
        [WebGet(UriTemplate = "SubtractLife/{userId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string SubTractLife(string userId);

        //[OperationContract]
        //[WebGet(UriTemplate = "SetLife/{json}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        //string SetLife(string json);


        [OperationContract]
        [WebGet(UriTemplate = "UpdatePlayerDataBlueTooth/{userId}/{userName}/{lifeValue}/{bulletCount}/{fightScore}/{notificationMesage}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        void UpdatePlayerDataBlueTooth(string userId,string userName,string lifeValue, string bulletCount,string fightScore,string notificationMesage);


        [OperationContract]
        [WebGet(UriTemplate = "GetScoreByUser/{userId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string GetScoreByUser(string userId);


        [OperationContract]
        [WebGet(UriTemplate = "SearchBlueToothState/{userID}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string SearchBlueToothState(string userID);


        [OperationContract]
        [WebGet(UriTemplate = "GetGoldCoinList/{roomId}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string GetGoldCoinList(string roomId);


        [OperationContract]
        [WebGet(UriTemplate = "PayGoldCoin/{userId}/{count}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        string PayGoldCoin(string userId,string count);




    }
}
